package com.ghery.ftp.strategy;

import org.apache.commons.net.ftp.FTPFile;
import org.springframework.stereotype.Service;

/**
 * @author ghery
 * @date 2020/11/27 16:18
 * @desc 默认的文件过滤规则
 */
@Service
public class DefaultFTPFileFilterStrategy implements FtpFilterStrategy {

    @Override
    public boolean accept(FTPFile ftpFile) {
        //过滤临时文件
        if( ftpFile == null ||  ftpFile.getSize() == 0 || ftpFile.getName().contains("unimastmp")){
            return false;
        }
        return true;
    }
}
